Public Class Form1 Private Sub btnGo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGo.Click Dim ave As Double Dim total As Double ' acuumulator Dim count As Integer ' counter Dim numQuizzes As Integer Dim isConverted As Boolean Dim isConverted2 As Boolean ' convert # quizzes isConverted = Integer.TryParse(txtNumQuiz.Text, numQuizzes) ' check # quizzes If isConverted AndAlso numQuizzes > 0 Then For count = 1 To numQuizzes ' ask for current score Dim currentScoreString As String Dim currentScore As Double currentScoreString = InputBox("What is your score on quiz " & count & "?") ' convert and validate isConverted2 = Double.TryParse(currentScoreString, currentScore) If isConverted2 AndAlso currentScore >= 0 AndAlso currentScore <= 10 Then total = total + currentScore Else MsgBox("Please enter a quiz grade between 0 and 10") End If Next count txtTotal.Text = total.ToString("n2") ave = total / numQuizzes txtAve.Text = ave.ToString("n2") Else MsgBox("Please enter a number greater than zero") End If End Sub End Class